home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / DefineSprite_905 / frame_1 / DoAction.as
Text File  |  2007-09-28  |  2KB  |  92 lines

  1. function addScore(count)
  2. {
  3.    this.score += count;
  4.    this.score = Math.round(this.score);
  5. }
  6. function setLevel()
  7. {
  8.    var _loc3_ = undefined;
  9.    switch(_global.MallCrawl.level)
  10.    {
  11.       case 1:
  12.          _loc3_ = "one";
  13.          break;
  14.       case 2:
  15.          _loc3_ = "two";
  16.          break;
  17.       case 3:
  18.          _loc3_ = "three";
  19.    }
  20.    this.LevelDisplay.gotoAndStop(_loc3_);
  21. }
  22. function setLives(count)
  23. {
  24.    this.lives = count;
  25.    var _loc2_ = 1;
  26.    while(_loc2_ < 4)
  27.    {
  28.       this["Life" + _loc2_].gotoAndStop("off");
  29.       _loc2_ = _loc2_ + 1;
  30.    }
  31.    _loc2_ = 1;
  32.    while(_loc2_ < this.lives + 1)
  33.    {
  34.       this["Life" + _loc2_].gotoAndStop("on");
  35.       _loc2_ = _loc2_ + 1;
  36.    }
  37. }
  38. function setScore(count)
  39. {
  40.    this.score = count;
  41. }
  42. function setTimer(count)
  43. {
  44.    this.time = count;
  45. }
  46. function timeDown()
  47. {
  48.    if(!_global.MallCrawl.paused)
  49.    {
  50.       if(this.time > 0)
  51.       {
  52.          var _loc4_ = Math.floor(this.time / 60);
  53.          String(_loc4_).length != 1 ? null : (_loc4_ = "0" + _loc4_);
  54.          var _loc3_ = this.time % 60;
  55.          String(_loc3_).length != 1 ? null : (_loc3_ = "0" + _loc3_);
  56.          this.time = this.time - 1;
  57.          time_readable = _loc4_ + ":" + _loc3_;
  58.       }
  59.       else
  60.       {
  61.          time_readable = "00:00";
  62.          _global.MallCrawl.outOfTime();
  63.       }
  64.    }
  65. }
  66. function startTimer()
  67. {
  68.    this.interval_id = setInterval(this,"timeDown",1000);
  69. }
  70. function stopTimer()
  71. {
  72.    clearInterval(this.interval_id);
  73. }
  74. _global.Footer = this;
  75. var lives;
  76. var score;
  77. var time;
  78. var interval_id;
  79. _global.MallCrawl.lostLevel();
  80. this.onEnterFrame = function()
  81. {
  82.    if(score_readable + 5 < this.score)
  83.    {
  84.       score_readable += 5;
  85.    }
  86.    else
  87.    {
  88.       score_readable = this.score;
  89.    }
  90. };
  91. music_txt = "MUSIC " + String(_global.Music.state).toUpperCase();
  92.